package de.huk.test;

/**
 * @author Chris Wewerka
 */
public class Customer {

    private String id;
    private String firstName;
    private String lastName;
    private String street;
    private String housenumber;
    private String city;
    private String plz;

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(final String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(final String lastName) {
        this.lastName = lastName;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(final String street) {
        this.street = street;
    }

    public String getHousenumber() {
        return housenumber;
    }

    public void setHousenumber(final String housenumber) {
        this.housenumber = housenumber;
    }

    public String getCity() {
        return city;
    }

    public void setCity(final String city) {
        this.city = city;
    }

    @Override
    public String toString() {
        return "Kunde{" +
                "firstName='" + firstName + '\'' +
                ", lastName='" + lastName + '\'' +
                ", street='" + street + '\'' +
                ", housenumber='" + housenumber + '\'' +
                ", city='" + city + '\'' +
                '}';
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        final Customer kunde = (Customer) o;

        if (city != null ? !city.equals(kunde.city) : kunde.city != null) return false;
        if (firstName != null ? !firstName.equals(kunde.firstName) : kunde.firstName != null) return false;
        if (housenumber != null ? !housenumber.equals(kunde.housenumber) : kunde.housenumber != null) return false;
        if (lastName != null ? !lastName.equals(kunde.lastName) : kunde.lastName != null) return false;
        if (street != null ? !street.equals(kunde.street) : kunde.street != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = firstName != null ? firstName.hashCode() : 0;
        result = 31 * result + (lastName != null ? lastName.hashCode() : 0);
        result = 31 * result + (street != null ? street.hashCode() : 0);
        result = 31 * result + (housenumber != null ? housenumber.hashCode() : 0);
        result = 31 * result + (city != null ? city.hashCode() : 0);
        return result;
    }
}
